﻿using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Interop;
using System.Windows;

namespace ZhuXingFamilys.AuditIndicators
{
    [Transaction(TransactionMode.Manual)]
    public class AuditIndicatorsCommand : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            UIApplication uiapp = commandData.Application;

            AuditIndicators ram = AuditIndicators.getInstance();
            WindowInteropHelper eh = new WindowInteropHelper(ram);
            eh.Owner = Process.GetCurrentProcess().MainWindowHandle;

            ram.Show();
            ram.Activate();
            if (ram.WindowState == WindowState.Minimized)
            {
                ram.WindowState = WindowState.Normal;
            }
            return Result.Succeeded;
        }
    }
}
